package com.huitu.whht.base.core.api.wq.pcp;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;
import com.huitu.whht.api.core.common.util.LocalDateTimeUtil;
import java.time.LocalDateTime;
import com.huitu.whht.base.core.api.wq.pcp.entities.WqPcpD;
import com.huitu.whht.base.core.api.wq.pcp.entities.WqPcpDKey;
import com.huitu.whht.base.core.api.wq.pcp.entities.WqPcpDQo;
import com.huitu.whht.base.core.api.wq.pcp.service.IWqPcpDService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 理化指标项目数据表API,表名称: WQ_PCP_D <br/>
 * 日期: 2019-04-11
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("wq/pcp/d")
public class WqPcpDResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WqPcpDResource.class);

    private static final String UUID = "5787e4e7-2475-45a4-ac6a-d4e343d56ed1";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWqPcpDService wqPcpDService;

    /**
     * @api {get} wq/pcp/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)select by primary key
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/pcp/d/50298200/2015-07-02 00:00:00/1/1/1
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiSuccess {String}         stcd               测站编码
     * @apiSuccess {String}         prpnm              垂线编号
     * @apiSuccess {String}         lynm               层面编号
     * @apiSuccess {String}         wbtp               水体类型
     * @apiSuccess {Date}           spt                采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Double}         airt               气温
     * @apiSuccess {Integer}        atm                大气压
     * @apiSuccess {Integer}        ilmt               光照时间
     * @apiSuccess {Integer}        ilmi               光照强度
     * @apiSuccess {Double}         wt                 水温
     * @apiSuccess {Double}         ph                 pH值
     * @apiSuccess {Integer}        cond               电导率
     * @apiSuccess {Double}         redox              氧化还原电位
     * @apiSuccess {Integer}        chroma             色度
     * @apiSuccess {String}         smell              嗅和味
     * @apiSuccess {String}         neobj              肉眼可见物
     * @apiSuccess {Integer}        turb               浊度
     * @apiSuccess {Double}         clarity            透明度
     * @apiSuccess {Double}         ss                 悬浮物
     * @apiSuccess {Double}         mndg               矿化度
     * @apiSuccess {Double}         acid               酸度
     * @apiSuccess {Double}         talky              总碱度
     * @apiSuccess {Double}         hco3               重碳酸盐
     * @apiSuccess {Double}         co3                碳酸盐
     * @apiSuccess {Double}         dsco2              游离二氧化碳
     * @apiSuccess {Double}         agco2              侵蚀性二氧化碳
     * @apiSuccess {Double}         tsolid             总固体
     * @apiSuccess {Double}         tds                溶解性总固体
     * @apiSuccess {Double}         talatv             总α放射性
     * @apiSuccess {Double}         tbtatv             总β放射性
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         speRegData         特殊区域
     * @apiSuccess {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp) {
        WqPcpDKey pk = new WqPcpDKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        pk.setPrpnm(prpnm);
        pk.setLynm(lynm);
        pk.setWbtp(wbtp);
        LOGGER.info("根据主键查询 理化指标项目数据表,参数 pk:{}", pk);
        return Response.ok(ApiResultBuilder.create(this, wqPcpDService.selectByPrimaryKey(pk))).build();
    }

    /**
     * @api {post} wq/pcp/d/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)select by filter
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/pcp/d/list
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {List(String)}   prpnmList          (数组)垂线编号
     * @apiParam   {List(String)}   lynmList           (数组)层面编号
     * @apiParam   {List(String)}   wbtpList           (数组)水体类型
     * @apiParam   {Date}           sptBgTm            (开始时间)采样时间
     * @apiParam   {Date}           sptEdTm            (结束时间)采样时间
     * @apiParam   {List(Double)}   airtList           (数组)气温
     * @apiParam   {Integer}        atmMin             (最小)大气压
     * @apiParam   {Integer}        atmMax             (最大)大气压
     * @apiParam   {List(Integer)}  ilmtList           (数组)光照时间
     * @apiParam   {Integer}        ilmiMin            (最小)光照强度
     * @apiParam   {Integer}        ilmiMax            (最大)光照强度
     * @apiParam   {List(Double)}   wtList             (数组)水温
     * @apiParam   {List(Double)}   phList             (数组)pH值
     * @apiParam   {Integer}        condMin            (最小)电导率
     * @apiParam   {Integer}        condMax            (最大)电导率
     * @apiParam   {Double}         redoxMin           (最小)氧化还原电位
     * @apiParam   {Double}         redoxMax           (最大)氧化还原电位
     * @apiParam   {List(Integer)}  chromaList         (数组)色度
     * @apiParam   {List(String)}   smellList          (数组)嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {List(Integer)}  turbList           (数组)浊度
     * @apiParam   {Double}         clarityMin         (最小)透明度
     * @apiParam   {Double}         clarityMax         (最大)透明度
     * @apiParam   {Double}         ssMin              (最小)悬浮物
     * @apiParam   {Double}         ssMax              (最大)悬浮物
     * @apiParam   {Double}         mndgMin            (最小)矿化度
     * @apiParam   {Double}         mndgMax            (最大)矿化度
     * @apiParam   {List(Double)}   acidList           (数组)酸度
     * @apiParam   {Double}         talkyMin           (最小)总碱度
     * @apiParam   {Double}         talkyMax           (最大)总碱度
     * @apiParam   {Double}         hco3Min            (最小)重碳酸盐
     * @apiParam   {Double}         hco3Max            (最大)重碳酸盐
     * @apiParam   {Double}         co3Min             (最小)碳酸盐
     * @apiParam   {Double}         co3Max             (最大)碳酸盐
     * @apiParam   {List(Double)}   dsco2List          (数组)游离二氧化碳
     * @apiParam   {List(Double)}   agco2List          (数组)侵蚀性二氧化碳
     * @apiParam   {Double}         tsolidMin          (最小)总固体
     * @apiParam   {Double}         tsolidMax          (最大)总固体
     * @apiParam   {Double}         tdsMin             (最小)溶解性总固体
     * @apiParam   {Double}         tdsMax             (最大)溶解性总固体
     * @apiParam   {Double}         talatvMin          (最小)总α放射性
     * @apiParam   {Double}         talatvMax          (最大)总α放射性
     * @apiParam   {Double}         tbtatvMin          (最小)总β放射性
     * @apiParam   {Double}         tbtatvMax          (最大)总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   speRegDataList     (数组)特殊区域
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {Date}           testComTmBgTm      (开始时间)化验完成时间
     * @apiParam   {Date}           testComTmEdTm      (结束时间)化验完成时间
     * @apiSuccess {String}         stcd               测站编码
     * @apiSuccess {String}         prpnm              垂线编号
     * @apiSuccess {String}         lynm               层面编号
     * @apiSuccess {String}         wbtp               水体类型
     * @apiSuccess {Date}           spt                采样时间
     * @apiSuccess {Double}         airt               气温
     * @apiSuccess {Integer}        atm                大气压
     * @apiSuccess {Integer}        ilmt               光照时间
     * @apiSuccess {Integer}        ilmi               光照强度
     * @apiSuccess {Double}         wt                 水温
     * @apiSuccess {Double}         ph                 pH值
     * @apiSuccess {Integer}        cond               电导率
     * @apiSuccess {Double}         redox              氧化还原电位
     * @apiSuccess {Integer}        chroma             色度
     * @apiSuccess {String}         smell              嗅和味
     * @apiSuccess {String}         neobj              肉眼可见物
     * @apiSuccess {Integer}        turb               浊度
     * @apiSuccess {Double}         clarity            透明度
     * @apiSuccess {Double}         ss                 悬浮物
     * @apiSuccess {Double}         mndg               矿化度
     * @apiSuccess {Double}         acid               酸度
     * @apiSuccess {Double}         talky              总碱度
     * @apiSuccess {Double}         hco3               重碳酸盐
     * @apiSuccess {Double}         co3                碳酸盐
     * @apiSuccess {Double}         dsco2              游离二氧化碳
     * @apiSuccess {Double}         agco2              侵蚀性二氧化碳
     * @apiSuccess {Double}         tsolid             总固体
     * @apiSuccess {Double}         tds                溶解性总固体
     * @apiSuccess {Double}         talatv             总α放射性
     * @apiSuccess {Double}         tbtatv             总β放射性
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         speRegData         特殊区域
     * @apiSuccess {Date}           ts                 时间戳
     * @apiSuccess {Date}           testComTm          化验完成时间
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WqPcpDQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 理化指标项目数据表,参数 WqPcpDQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wqPcpDService.selectList(filter))).build();
    }

    /**
     * @api {put} wq/pcp/d [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)add data
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiParam   {Date}           spt                【必须】采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         airt               气温
     * @apiParam   {Integer}        atm                大气压
     * @apiParam   {Integer}        ilmt               光照时间
     * @apiParam   {Integer}        ilmi               光照强度
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Double}         redox              氧化还原电位
     * @apiParam   {Integer}        chroma             色度
     * @apiParam   {String}         smell              嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         clarity            透明度
     * @apiParam   {Double}         ss                 悬浮物
     * @apiParam   {Double}         mndg               矿化度
     * @apiParam   {Double}         acid               酸度
     * @apiParam   {Double}         talky              总碱度
     * @apiParam   {Double}         hco3               重碳酸盐
     * @apiParam   {Double}         co3                碳酸盐
     * @apiParam   {Double}         dsco2              游离二氧化碳
     * @apiParam   {Double}         agco2              侵蚀性二氧化碳
     * @apiParam   {Double}         tsolid             总固体
     * @apiParam   {Double}         tds                溶解性总固体
     * @apiParam   {Double}         talatv             总α放射性
     * @apiParam   {Double}         tbtatv             总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/pcp/d
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "50298200",
     *   "spt": "2015-07-02 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "50298200",
     *   "spt": "2015-07-02 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WqPcpD record) {
        LOGGER.info("新增 理化指标项目数据表,参数 WqPcpD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqPcpDService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} wq/pcp/d/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)addBatch data
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiParam   {Date}           spt                【必须】采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         airt               气温
     * @apiParam   {Integer}        atm                大气压
     * @apiParam   {Integer}        ilmt               光照时间
     * @apiParam   {Integer}        ilmi               光照强度
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Double}         redox              氧化还原电位
     * @apiParam   {Integer}        chroma             色度
     * @apiParam   {String}         smell              嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         clarity            透明度
     * @apiParam   {Double}         ss                 悬浮物
     * @apiParam   {Double}         mndg               矿化度
     * @apiParam   {Double}         acid               酸度
     * @apiParam   {Double}         talky              总碱度
     * @apiParam   {Double}         hco3               重碳酸盐
     * @apiParam   {Double}         co3                碳酸盐
     * @apiParam   {Double}         dsco2              游离二氧化碳
     * @apiParam   {Double}         agco2              侵蚀性二氧化碳
     * @apiParam   {Double}         tsolid             总固体
     * @apiParam   {Double}         tds                溶解性总固体
     * @apiParam   {Double}         talatv             总α放射性
     * @apiParam   {Double}         tbtatv             总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/pcp/d/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "50298200",
     *   "spt": "2015-07-02 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "50298200",
     *   "spt": "2015-07-02 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WqPcpD> recordList) {
        LOGGER.info("批量新增 理化指标项目数据表,参数 WqPcpD:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqPcpDService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} wq/pcp/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)update data
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {Double}         airt               气温
     * @apiParam   {Integer}        atm                大气压
     * @apiParam   {Integer}        ilmt               光照时间
     * @apiParam   {Integer}        ilmi               光照强度
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Double}         redox              氧化还原电位
     * @apiParam   {Integer}        chroma             色度
     * @apiParam   {String}         smell              嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         clarity            透明度
     * @apiParam   {Double}         ss                 悬浮物
     * @apiParam   {Double}         mndg               矿化度
     * @apiParam   {Double}         acid               酸度
     * @apiParam   {Double}         talky              总碱度
     * @apiParam   {Double}         hco3               重碳酸盐
     * @apiParam   {Double}         co3                碳酸盐
     * @apiParam   {Double}         dsco2              游离二氧化碳
     * @apiParam   {Double}         agco2              侵蚀性二氧化碳
     * @apiParam   {Double}         tsolid             总固体
     * @apiParam   {Double}         tds                溶解性总固体
     * @apiParam   {Double}         talatv             总α放射性
     * @apiParam   {Double}         tbtatv             总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 【必须】时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/pcp/d/50298200/2015-07-02 00:00:00/1/1/1/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp, WqPcpD record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        record.setPrpnm(prpnm);
        record.setLynm(lynm);
        record.setWbtp(wbtp);
        LOGGER.info("根据主键修改 理化指标项目数据表,参数 WqPcpD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqPcpDService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} wq/pcp/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改WQ_PCP_D(理化指标项目数据表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {String}         prpnm              垂线编号
     * @apiParam   {String}         lynm               层面编号
     * @apiParam   {String}         wbtp               水体类型
     * @apiParam   {Date}           spt                采样时间
     * @apiParam   {Double}         airt               气温
     * @apiParam   {Integer}        atm                大气压
     * @apiParam   {Integer}        ilmt               光照时间
     * @apiParam   {Integer}        ilmi               光照强度
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Double}         redox              氧化还原电位
     * @apiParam   {Integer}        chroma             色度
     * @apiParam   {String}         smell              嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         clarity            透明度
     * @apiParam   {Double}         ss                 悬浮物
     * @apiParam   {Double}         mndg               矿化度
     * @apiParam   {Double}         acid               酸度
     * @apiParam   {Double}         talky              总碱度
     * @apiParam   {Double}         hco3               重碳酸盐
     * @apiParam   {Double}         co3                碳酸盐
     * @apiParam   {Double}         dsco2              游离二氧化碳
     * @apiParam   {Double}         agco2              侵蚀性二氧化碳
     * @apiParam   {Double}         tsolid             总固体
     * @apiParam   {Double}         tds                溶解性总固体
     * @apiParam   {Double}         talatv             总α放射性
     * @apiParam   {Double}         tbtatv             总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/pcp/d/50298200/2015-07-02 00:00:00/1/1/1/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp, WqPcpD record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        record.setPrpnm(prpnm);
        record.setLynm(lynm);
        record.setWbtp(wbtp);
        LOGGER.info("根据主键修改(只修改非null字段) 理化指标项目数据表,参数 WqPcpD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqPcpDService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} wq/pcp/d/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改WQ_PCP_D(理化指标项目数据表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {String}         prpnm              垂线编号
     * @apiParam   {String}         lynm               层面编号
     * @apiParam   {String}         wbtp               水体类型
     * @apiParam   {Date}           spt                采样时间
     * @apiParam   {Double}         airt               气温
     * @apiParam   {Integer}        atm                大气压
     * @apiParam   {Integer}        ilmt               光照时间
     * @apiParam   {Integer}        ilmi               光照强度
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Double}         redox              氧化还原电位
     * @apiParam   {Integer}        chroma             色度
     * @apiParam   {String}         smell              嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         clarity            透明度
     * @apiParam   {Double}         ss                 悬浮物
     * @apiParam   {Double}         mndg               矿化度
     * @apiParam   {Double}         acid               酸度
     * @apiParam   {Double}         talky              总碱度
     * @apiParam   {Double}         hco3               重碳酸盐
     * @apiParam   {Double}         co3                碳酸盐
     * @apiParam   {Double}         dsco2              游离二氧化碳
     * @apiParam   {Double}         agco2              侵蚀性二氧化碳
     * @apiParam   {Double}         tsolid             总固体
     * @apiParam   {Double}         tds                溶解性总固体
     * @apiParam   {Double}         talatv             总α放射性
     * @apiParam   {Double}         tbtatv             总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  wq/pcp/d/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "50298200",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2015-07-02 00:00:00.0",
     * "airt": null,
     * "atm": null,
     * "ilmt": null,
     * "ilmi": null,
     * "wt": 23,
     * "ph": 7.3,
     * "cond": null,
     * "redox": null,
     * "chroma": null,
     * "smell": null,
     * "neobj": null,
     * "turb": null,
     * "clarity": null,
     * "ss": null,
     * "mndg": null,
     * "acid": null,
     * "talky": null,
     * "hco3": null,
     * "co3": null,
     * "dsco2": null,
     * "agco2": null,
     * "tsolid": null,
     * "tds": null,
     * "talatv": null,
     * "tbtatv": null,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2015-07-27 17:58:06.0",
     * "testComTm": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WqPcpD> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 理化指标项目数据表,参数 WqPcpD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqPcpDService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} wq/pcp/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/pcp/d/50298200/2015-07-02 00:00:00/1/1/1
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp) {
         WqPcpDKey pk = new WqPcpDKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        pk.setPrpnm(prpnm);
        pk.setLynm(lynm);
        pk.setWbtp(wbtp);
        LOGGER.info("根据主键删除 理化指标项目数据表,参数 pk:{}", pk);
        Integer rows = wqPcpDService.deleteByPrimaryKey(pk);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} wq/pcp/d/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除WQ_PCP_D(理化指标项目数据表)数据
     * @apiName (generate)delete by filter
     * @apiGroup WQ_PCP_D-理化指标项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/pcp/d/by-filter
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {List(String)}   prpnmList          (数组)垂线编号
     * @apiParam   {List(String)}   lynmList           (数组)层面编号
     * @apiParam   {List(String)}   wbtpList           (数组)水体类型
     * @apiParam   {Date}           sptBgTm            (开始时间)采样时间
     * @apiParam   {Date}           sptEdTm            (结束时间)采样时间
     * @apiParam   {List(Double)}   airtList           (数组)气温
     * @apiParam   {Integer}        atmMin             (最小)大气压
     * @apiParam   {Integer}        atmMax             (最大)大气压
     * @apiParam   {List(Integer)}  ilmtList           (数组)光照时间
     * @apiParam   {Integer}        ilmiMin            (最小)光照强度
     * @apiParam   {Integer}        ilmiMax            (最大)光照强度
     * @apiParam   {List(Double)}   wtList             (数组)水温
     * @apiParam   {List(Double)}   phList             (数组)pH值
     * @apiParam   {Integer}        condMin            (最小)电导率
     * @apiParam   {Integer}        condMax            (最大)电导率
     * @apiParam   {Double}         redoxMin           (最小)氧化还原电位
     * @apiParam   {Double}         redoxMax           (最大)氧化还原电位
     * @apiParam   {List(Integer)}  chromaList         (数组)色度
     * @apiParam   {List(String)}   smellList          (数组)嗅和味
     * @apiParam   {String}         neobj              肉眼可见物
     * @apiParam   {List(Integer)}  turbList           (数组)浊度
     * @apiParam   {Double}         clarityMin         (最小)透明度
     * @apiParam   {Double}         clarityMax         (最大)透明度
     * @apiParam   {Double}         ssMin              (最小)悬浮物
     * @apiParam   {Double}         ssMax              (最大)悬浮物
     * @apiParam   {Double}         mndgMin            (最小)矿化度
     * @apiParam   {Double}         mndgMax            (最大)矿化度
     * @apiParam   {List(Double)}   acidList           (数组)酸度
     * @apiParam   {Double}         talkyMin           (最小)总碱度
     * @apiParam   {Double}         talkyMax           (最大)总碱度
     * @apiParam   {Double}         hco3Min            (最小)重碳酸盐
     * @apiParam   {Double}         hco3Max            (最大)重碳酸盐
     * @apiParam   {Double}         co3Min             (最小)碳酸盐
     * @apiParam   {Double}         co3Max             (最大)碳酸盐
     * @apiParam   {List(Double)}   dsco2List          (数组)游离二氧化碳
     * @apiParam   {List(Double)}   agco2List          (数组)侵蚀性二氧化碳
     * @apiParam   {Double}         tsolidMin          (最小)总固体
     * @apiParam   {Double}         tsolidMax          (最大)总固体
     * @apiParam   {Double}         tdsMin             (最小)溶解性总固体
     * @apiParam   {Double}         tdsMax             (最大)溶解性总固体
     * @apiParam   {Double}         talatvMin          (最小)总α放射性
     * @apiParam   {Double}         talatvMax          (最大)总α放射性
     * @apiParam   {Double}         tbtatvMin          (最小)总β放射性
     * @apiParam   {Double}         tbtatvMax          (最大)总β放射性
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   speRegDataList     (数组)特殊区域
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {Date}           testComTmBgTm      (开始时间)化验完成时间
     * @apiParam   {Date}           testComTmEdTm      (结束时间)化验完成时间
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WqPcpDQo filter) {
        LOGGER.info("根据条件删除 理化指标项目数据表,参数 WqPcpDQo:{}", filter);
        Integer rows = wqPcpDService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
